package com.xmsit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xmsit.pojo.AdsMileageStatLastMonth;
import com.xmsit.pojo.AdsTemperatureStatLastMonth;
import com.xmsit.service.AdsTemperatureStatLastMonthService;
import com.xmsit.mapper.AdsTemperatureStatLastMonthMapper;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
* @author 徐
* @description 针对表【ads_temperature_stat_last_month(温控相关统计)】的数据库操作Service实现
* @createDate 2025-04-18 22:09:14
*/
@Service
public class AdsTemperatureStatLastMonthServiceImpl extends ServiceImpl<AdsTemperatureStatLastMonthMapper, AdsTemperatureStatLastMonth>
    implements AdsTemperatureStatLastMonthService{

    @Override
    public List<AdsTemperatureStatLastMonth> getAdsTemperatureStatLastMonth(AdsTemperatureStatLastMonth adsTemperatureStatLastMonth) {
        LambdaQueryWrapper<AdsTemperatureStatLastMonth> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AdsTemperatureStatLastMonth::getVin, adsTemperatureStatLastMonth.getVin());
        if(adsTemperatureStatLastMonth.getMon() != null) {
            queryWrapper.eq(AdsTemperatureStatLastMonth::getMon, adsTemperatureStatLastMonth.getMon());
        }
        List<AdsTemperatureStatLastMonth> list = this.list(queryWrapper);
        return list;
    }
}




